//
//  NSString+CZNSStringExt.m
//  QQ聊天界面
//
//  Created by MAC on 16-3-14.
//  Copyright (c) 2016年 MAC. All rights reserved.
//

#import "NSString+CZNSStringExt.h"
#import <UIKit/UIKit.h>
@implementation NSString (CZNSStringExt)
//对象方法
-(CGSize)sizeOfTextWithMaxSize:(CGSize)maxSize font:(UIFont*)font
{
    NSDictionary* attrs = @{NSFontAttributeName:font};
    return [self boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:attrs context:nil].size;
}

//类方法
+(CGSize)sizeWithText:(NSString*)text maxSize:(CGSize)maxSize font:(UIFont*)font
{
    return [text sizeOfTextWithMaxSize:maxSize font:font];
}
@end
